<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="waeather, forecast, australia weather, school temparature, school weather" />
<meta name="description" content="Townsville Weather Simulation" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Townsville Weather Simulation</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
	<div id="header">
		<div id="logo">
            <img src="images/weather.jpg" width=900px height=150px border=0 />
		</div>
	</div>
	<!-- end #header -->
	<div id="menu">
		
		<ul>
			<li><a href="index.php">Townsville Weather</a></li>
			<li><a href="wnews.php">Weather News</a></li>
			<li><a href="videos.php">Knowledge Repository</a></li>
			<li><a href="aboutus.php">Abous Us</a></li>
            <li><a href="feedback.php">Feedback</a></li>
			<li><a href="contactus.php">Contact Us</a></li>
		</ul>
		
	</div>
	<!-- end #menu -->

<div id="wrapper">
<div class="btm">
	<div id="page">
		<div id="content" align=center>
			
				<h1 class="title" align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">Submit Feedback</a></h1>
			
<br><br><br><br>						
<?php
try
{
// Import database util script once to get the properties and getConnection() function
require_once 'databaseUtil.php';
$stConn = getConnection();
$isCall=0;
$isMail=0;
// Check "I would like to get call" check box is ticked, set 1 for YES, 0 for NO
if(isset($_POST['iscall']))
{
$isCall=1;
}

// Check "I would like to get email" check box is ticked, set 1 for YES, 0 for NO
if(isset($_POST['ismail']))
{
$isMail=1;
}

$insert_sql="insert into feedback values('$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[phone]','$_POST[age]',$isCall,$isMail,'$_POST[comment]')";


// Result set for query
$comments = mysql_query($insert_sql,$stConn);
closeConnection($stConn);
echo "<h3>Thank you for posting your valuable feedback. It has been stored in our database.</h3>";
}catch(Exception $dbEX)
{
closeConnection($stConn);
echo "<h3>System Error: An error occured while storing your feedback. Please try later.</h3>";
}


?> 
						
									
<br><br><br><br><br><br><br>

</div>      
           
            
            
		</div>
		<!-- end #content -->
		
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>

	<div id="footer">
		<p>
        	<a href="index.php">Townsville Weather</a> |
			<a href="wnews.php">Weather News</a> |
			<a href="videos.php">Knowledge Repository</a> |
			<a href="aboutus.php">Abous Us</a> |
            <a href="feedback.php">Feedback</a> |
			<a href="contactus.php">Contact Us</a><br><br>
        Copyright (c) 2010 JCU - Townsville Weather Simulation Project. All rights reserved.</p>
	</div>
	<!-- end #footer -->
</body>
</html>